﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class UILogin : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void correctCurrentActorIndex() {
		if(m_currentActorIndex < 0){
			m_currentActorIndex = 0;
		}
		if(m_currentActorIndex >= m_ActorTextures.Count){
			m_currentActorIndex = m_ActorTextures.Count - 1;
		}
	}
	
	void OnButtonPreActorClicked() {
		m_currentActorIndex--;
		correctCurrentActorIndex();
		m_UITextureActorHead.mainTexture = m_ActorTextures[m_currentActorIndex];
	}
	
	void OnButtonNextActorClicked() {
		m_currentActorIndex++;
		correctCurrentActorIndex();
		m_UITextureActorHead.mainTexture = m_ActorTextures[m_currentActorIndex];
	}
	
	int m_currentActorIndex = 0;
	public UITexture m_UITextureActorHead;
	public List<Texture> m_ActorTextures = new List<Texture>();
}
